# JupyterLab可以看作是Jupyter Notebook的超集，提供了更丰富的功能和更好的用户体验

#系统镜像使用国内的这种，毕竟centos已经停更了
#   https://gitee.com/anolis/rnotes/blob/master/anolis/rnotes/anolis-23.1-ga.md#23-%E5%AE%B9%E5%99%A8%E9%95%9C%E5%83%8F
FROM registry.openanolis.cn/openanolis/anolisos:23.1

RUN dnf install -y python3 python3-pip && \
    dnf install -y glibc-langpack-zh fontconfig && \
    update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \
    update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 &&\
    dnf clean all

RUN pip3 install --index-url https://mirrors.aliyun.com/pypi/simple jupyterlab==4.3.0  requests &&\
    rm -rf /root/.cache/pip

# 创建工作目录
WORKDIR /workspace
# 暴露 JupyterLab 默认端口
EXPOSE 8888

ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ENV LANGUAGE zh_CN.UTF-8

# 配置 JupyterLab
#RUN jupyter lab --generate-config &&\
# https://siwei.io/nebulagraph-in-jupyter-notebook/
RUN pip install --index-url https://mirrors.aliyun.com/pypi/simple ipython-ngql
COPY ./jupyter_lab_config.py /root/.jupyter/jupyter_lab_config.py

# 启动 JupyterLab
CMD ["jupyter", "lab", "--no-browser", "--port=8888", "--allow-root"]
